package com.sn.author.common.sdk.request;

import com.sn.author.common.sdk.AbstractRequest;
import com.sn.author.common.sdk.response.ImportUserResponse;
import lombok.Getter;
import lombok.Setter;

import java.util.Map;

/**
 * @Author xiaom
 * @Date 2020/7/24 15:09
 * @Version 1.0.0
 * @Description <导入IM账号 api地址：https://cloud.tencent.com/document/product/269/1608>
 **/
@Getter
@Setter
public class ImportUserRequest extends AbstractRequest implements Request<ImportUserResponse> {

    /**
     * 用户名，长度不超过32字节
     */
    private Long userId;
    /**
     * 用户昵称
     */
    private String nickName;
    /**
     * 用户头像 URL
     */
    private String avatarUrl;


    @Override
    protected void setUrlParamsMap(Map<String, Object> map) {
        map.put("Identifier", userId + "");
        map.put("Nick", nickName);
    }

    @Override
    public String getApiUrl() {
        return super.getBaseUrl() + "/v4/im_open_login_svc/account_import";
    }

    @Override
    public Class<ImportUserResponse> getResponseClass() {
        return ImportUserResponse.class;
    }

    @Override
    public Object getUrlParams() {
        setUrlParamsMap(super.urlParamsMap);
        return super.urlParamsMap;
    }

    @Override
    public Object initRequestParams(Map<String, String> paramsMap) {
        return super.initRequestParams(paramsMap, getApiUrl());
    }
}
